﻿<div class="viewport" style="height:@(Model.Height)px">
    @if (JsModule != null)
    {
        <RulesEngineToolbar @ref="RulesEngineToolbar"
                            WorkflowEleId="@WorkflowEleId"
                            RulesEngineJsModule="JsModule"
                            UndoManager="UndoManager"
                            RefreshViewport="StateHasChanged" />
    }
    <div id="@WorkflowEleId" class="workflow">
        @if (Workflow != null)
        {
            <RuleNodeContainer Rules="Workflow.Rules"
                               IsReadOnly="Model.IsReadOnly"
                               ContainerChanged="RulesChangedAsync" />
        }
    </div>
</div>

@code {
    public static RenderFragment Create(RulesEngineModel model)
    {
        return @<RulesEngineRenderer Model="model" />;
    }
}